<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>A Common C++ ABI for GNU/Linux</title>
<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
</head>

  <body>
    <h1>A Common C++ ABI for GNU/Linux</h1>

    <p>
    The main point of the GCC 3.2 release is to have a relatively
    stable and common C++ ABI for GNU/Linux and BSD usage, following
    the Itanium C++ ABI.</p>
   
    <p>Unfortunately this means that GCC 3.2 is incompatible with GCC 3.0
    and GCC 3.1 releases.</p>

    <p>
    But for real interoperability of C++ shared libraries and C++
    programs, not only does a GCC 3.2 based compiler have to be used,
    but it also has to be built in a certain environment and with some
    specific options.</p>

    <p> We strongly advise all developers and distributors to follow
    the guidelines given here for GNU/Linux systems.</p>

   <h2>Configuring GCC</h2>

    <p>Configure GCC with this options:</p>
    <pre>
      --enable-__cxa_atexit
    </pre>

    <p>GCC is configured by default on GNU/Linux systems also with
    these two flags, do not change them to any other value:</p>
    <pre>
      --enable-threads=posix --enable-shared
    </pre>
    <p>If you do not use these options, your files generated by GCC
    will not be fully ABI compatible.</p>

   <h2>Glibc</h2>

    <p> On GNU/Linux systems use the GNU C Library version 2.2.5 or
    newer.
    </p>

    <h2>Binutils</h2>

    <p>
    Use binutils 2.12.1 or any newer release.
    </p>

    <h2>Order of Builds</h2>

   <p>Since GCC and glibc test for some features of binutils and
   glibc, you have to build and install new versions (if needed) in
   this order:</p>
    <ol>
      <li>New binutils version</li>
      <li>New glibc version (on GNU/Linux systems only)</li>
      <li>GCC 3.2</li>
    </ol>
    <p>Especially, if you update binutils, you should rebuild glibc so
    that glibc can take advantage of some new options of binutils.</p>

    <h2>Caveat</h2>

    <p>Since GCC now implements a written ABI that is also implemented
    by other compiler vendors, it might be that we encounter different
    interpretations of the ABI by the vendors, bugs in the ABI or bugs
    in the implementation of the ABI in different compilers.</p>

    <p>
    We have tried hard to have a stable ABI that is compatible with
    future GCC releases.  At this point no promise can be made
    that this release will be ABI compatible with all future GCC 3.x
    versions but we will strive hard to keep GCC 3.3 compatible with
    GCC 3.2.</p>

  </body>
</html>
